package com.example.starseas_phone.Adapters;

import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.viewpager.widget.PagerAdapter;

import java.util.List;

public class GuidePageAdapter extends PagerAdapter {
    List<View> list;

    public GuidePageAdapter(List<View> list){
        this.list = list;
    }

    @Override
    public int getCount(){
        return list.size();
    }

    @Override
    public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
        return view==object;
    }

    @Override
    public void destroyItem(ViewGroup container,int position,Object object){
        container.removeView(list.get(position));
    }

    @Override
    public Object instantiateItem(ViewGroup container,int position){
        container.addView(list.get(position));
        return  list.get(position);
    }


}
